fn string_equal(string1: *mut std::ffi::c_void, string2: *mut std::ffi::c_void) -> i32 {
    unsafe {
        let str1 = CStr::from_ptr(string1 as *const c_char);
        let str2 = CStr::from_ptr(string2 as *const c_char);
        (str1 == str2) as i32
    }
}
fn string_compare(string1: *mut std::ffi::c_void, string2: *mut std::ffi::c_void) -> i32 {
    unsafe {
        let result = libc::strcmp(string1 as *const c_char, string2 as *const c_char);
        if result < 0 {
            -1
        } else if result > 0 {
            1
        } else {
            0
        }
    }
}
fn string_nocase_equal(string1: *mut std::ffi::c_void, string2: *mut std::ffi::c_void) -> i32 {
    unsafe { (string_nocase_compare(string1, string2) == 0) as i32 }
}
fn string_nocase_compare(string1: *mut c_void, string2: *mut c_void) -> i32 {
    unsafe {
        let mut p1 = string1 as *const c_char;
        let mut p2 = string2 as *const c_char;
        loop {
            let c1 = p1.read().to_ascii_lowercase();
            let c2 = p2.read().to_ascii_lowercase();
            if c1 != c2 {
                return if c1 < c2 { -1 } else { 1 };
            }
            if c1 == '\0' as c_char {
                break;
            }
            p1 = p1.add(1);
            p2 = p2.add(1);
        }
        0
    }
}
